package com.lagou.edu.dao;

import com.lagou.pojo.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;

/**
 * @author caiwei
 * @date 2020-11-20 9:16
 */
public interface LagouAuthCodeDao extends JpaRepository<LagouAuthCode,Integer> {

    //获取到该邮箱最后一次发验证码的信息
    LagouAuthCode findFirstByEmailOrderByIdDesc(String email);


    //查询是否在一分钟之内是否发送过验证码
    LagouAuthCode findFirstByEmailAndCreatetimeAfter(String email, Date startTime);

}
